using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.Unity;

namespace UnityContrib.CanonicalObjectExtension
{
    public abstract class CanonicalObjectBase : UnityContainerExtension, ICanonicalObject
    {
        #region RegisterPartialType Base Implementations 
  
        public ICanonicalObject RegisterPartialType<typeFrom,typeTo>(string canonicalName,string typeName, LifetimeManager lifetimeManager, params InjectionMember[] injectionMembers) 
        {
            return RegisterPartialType(typeof(typeFrom), typeof(typeTo), canonicalName,typeName, lifetimeManager, injectionMembers);
        }
        public ICanonicalObject RegisterPartialType<typeFrom,typeTo>(string canonicalName, string typeName, LifetimeManager lifetimeManager) 
        {
            return RegisterPartialType(typeof(typeFrom), typeof(typeTo), canonicalName, typeName, lifetimeManager, null);
        }
        public ICanonicalObject RegisterPartialType<typeFrom, typeTo>(string canonicalName, string typeName)
        {
            return RegisterPartialType(typeof(typeFrom), typeof(typeTo), canonicalName,typeName, null, null);
        }
        public ICanonicalObject RegisterPartialType<typeFrom, typeTo>(string canonicalName)
        {
            return RegisterPartialType(typeof(typeFrom), typeof(typeTo), canonicalName, string.Empty, null, null);
        }
        public ICanonicalObject RegisterPartialType<typeTo>(string canonicalName, string typeName, LifetimeManager lifetimeManager, params InjectionMember[] injectionMembers) 
        {
            return RegisterPartialType(null, typeof(typeTo), canonicalName, typeName, lifetimeManager, injectionMembers);
        }
        public ICanonicalObject RegisterPartialType<typeTo>(string canonicalName)
        {
            return RegisterPartialType(null, typeof(typeTo), canonicalName, null, null);
        }

        #endregion 

        public abstract ICanonicalObject RegisterPartialType(Type fromType, Type toType, string canonicalName, string typeName, LifetimeManager lifetimeManager, params InjectionMember[] injectionMembers);
        public abstract ICanonicalObject RemovePartialType(Type fromType, Type toType, string canonicalName, string typeName);
        public abstract void ConfigureDefaultExtension();

    }
}
